/** @file gui_label.h
    @brief A label widget */

#ifndef G3_GUI_LABEL_H
#define G3_GUI_LABEL_H

#include "gui/gui_widget.h"

namespace G3 {
namespace GUI {

/** @class LABEL
    @brief A label widget class */
class LABEL: public WIDGET {
	public:
        /**
            @brief Constructor
        */
		LABEL ();
        /**
            @brief Destructor
        */
		virtual ~LABEL () {
			Font = NULL;
			Value = "";
		}

        /** Pointer to the font */
		FONT *Font;
		/** Color of the font */
		COL4F Color;
		/** Text value */
		string Value;
		/** Is the text clipped by the widget rectangle ? */
		bool ClippedByRect;

        /**
            @brief Assignment operator
            @param[in] aLabel Reference to the label to be copied
            @return Reference to the freshly copied label
        */
		LABEL& operator= (const LABEL &aLabel);

        /**
            @brief Creates the label
            @param[in] aPosition Reference to the label position
            @param[in] aFont Pointer to the label font
        */
		void Create (const VEC2I &aPosition, FONT *aFont);

        /**
            @brief Shrinks the label to its contents
        */
		void Shrink ();

        /**
            @brief Attaches a font to the label
            @param[in] aFont pointer to the new font
        */
		void AttachFont (G3::FONT *aFont);

        /**
            @brief Sets label value
            @param[in] aValue Reference to the new value string
        */
		void SetValue (const string &aValue);

        /**
            @brief Printf-like formatting for the value
            @param[in] aFormat Pointer to the format string
        */
		void Print (const char *aFormat, ...);

        /**
            @brief Draws the label
            @param[in] aElapsedTime The elapsed time since the last call
        */
		void Draw (float aElapsedTime = 0.0f);

        /**
            @brief Gets the type of this widget
            @return The type index \see TYPE_MANAGER
        */
		virtual uint GetType () { return MainTypeMgr.GetType ("W_LABEL"); }

        /**
            @brief Is this widget static ?
            @return True.
        */
		virtual bool IsStatic () { return true; }
};

}
}

#endif // G3_GUI_LABEL_H
